package tania.coca.ejercicios.semaforo;

import java.awt.BorderLayout;
import javax.swing.JPanel;
import javax.swing.JFrame;
import java.awt.Dimension;
import javax.swing.JLabel;
import java.awt.Rectangle;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.SwingConstants;
import java.awt.Point;
import java.awt.ComponentOrientation;
import java.awt.event.KeyEvent;

public class Calles extends JFrame {

	private static final long serialVersionUID = 1L;

	private JPanel jContentPane = null;

	private JLabel jLabel = null;

	private JButton jButton = null;

	private JButton jButton1 = null;

	private JButton jButton2 = null;

	private JButton jButton3 = null;

	private JButton jButton4 = null;

	private JButton jButton5 = null;

	private JButton jButton6 = null;

	private JButton jButton7 = null;

	/**
	 * This is the default constructor
	 */
	public Calles() {
		super();
		initialize();
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		this.setSize(664, 542);
		this.setContentPane(getJContentPane());
		this.setTitle("27 con Gomez");
		
		Thread t1 = new Thread(new Semaforo(6,'v',jButton,0));
		Thread t2 = new Thread(new Semaforo(6,'v',jButton5,0));
		
		Thread t3 = new Thread(new Semaforo(6,'v',jButton3,12));
		Thread t4 = new Thread(new Semaforo(6,'v',jButton6,12));
		
		Thread t5 = new Thread(new Semaforo(6,'v',jButton1,6));
		Thread t6 = new Thread(new Semaforo(6,'v',jButton4,6));
		
		Thread t7 = new Thread(new Semaforo(6,'v',jButton2,18));
		Thread t8 = new Thread(new Semaforo(6,'v',jButton7,18));
		
		t1.start();
		t2.start();
		t3.start();
		t4.start();
		t5.start();
		t6.start();
		t7.start();
		t8.start();
		
		
		
	}

	/**
	 * This method initializes jContentPane
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJContentPane() {
		if (jContentPane == null) {
			jLabel = new JLabel();
			jLabel.setBounds(new Rectangle(0, -6, 652, 512));
			jLabel.setIcon(new ImageIcon(getClass().getResource("/tania/coca/ejercicios/semaforo/calle.JPG")));
			jLabel.setText("");
			jContentPane = new JPanel();
			jContentPane.setLayout(null);
			jContentPane.add(getJButton(), null);jContentPane.add(getJButton(), null);
			jContentPane.add(getJButton1(), null);
			jContentPane.add(getJButton2(), null);
			jContentPane.add(getJButton3(), null);
			jContentPane.add(getJButton4(), null);
			jContentPane.add(getJButton5(), null);
			jContentPane.add(getJButton6(), null);
			jContentPane.add(getJButton7(), null);
			jContentPane.add(jLabel, null);
			
		}
		return jContentPane;
	}

	/**
	 * This method initializes jButton	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton() {
		if (jButton == null) {
			jButton = new JButton();
			jButton.setBounds(new Rectangle(400, 166, 43, 24));
			jButton.setComponentOrientation(ComponentOrientation.UNKNOWN);
			jButton.setHorizontalAlignment(SwingConstants.CENTER);
			jButton.setMnemonic(KeyEvent.VK_UNDEFINED);
			jButton.setText("r");
		}
		return jButton;
	}

	/**
	 * This method initializes jButton1	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton1() {
		if (jButton1 == null) {
			jButton1 = new JButton();
			jButton1.setText("r");
			jButton1.setSize(new Dimension(43, 24));
			jButton1.setLocation(new Point(400, 193));
		}
		return jButton1;
	}

	/**
	 * This method initializes jButton2	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton2() {
		if (jButton2 == null) {
			jButton2 = new JButton();
			jButton2.setBounds(new Rectangle(315, 138, 42, 25));
			jButton2.setMnemonic(KeyEvent.VK_UNDEFINED);
			jButton2.setHorizontalAlignment(SwingConstants.CENTER);
			jButton2.setText("r");
			jButton2.setComponentOrientation(ComponentOrientation.UNKNOWN);
		}
		return jButton2;
	}

	/**
	 * This method initializes jButton3	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton3() {
		if (jButton3 == null) {
			jButton3 = new JButton();
			jButton3.setBounds(new Rectangle(358, 138, 42, 25));
			jButton3.setMnemonic(KeyEvent.VK_UNDEFINED);
			jButton3.setHorizontalAlignment(SwingConstants.CENTER);
			jButton3.setText("r");
			jButton3.setComponentOrientation(ComponentOrientation.UNKNOWN);
		}
		return jButton3;
	}

	/**
	 * This method initializes jButton4	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton4() {
		if (jButton4 == null) {
			jButton4 = new JButton();
			jButton4.setBounds(new Rectangle(182, 229, 42, 25));
			jButton4.setMnemonic(KeyEvent.VK_UNDEFINED);
			jButton4.setHorizontalAlignment(SwingConstants.CENTER);
			jButton4.setText("r");
			jButton4.setComponentOrientation(ComponentOrientation.UNKNOWN);
		}
		return jButton4;
	}

	/**
	 * This method initializes jButton5	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton5() {
		if (jButton5 == null) {
			jButton5 = new JButton();
			jButton5.setBounds(new Rectangle(182, 259, 42, 25));
			jButton5.setMnemonic(KeyEvent.VK_UNDEFINED);
			jButton5.setHorizontalAlignment(SwingConstants.CENTER);
			jButton5.setText("r");
			jButton5.setComponentOrientation(ComponentOrientation.UNKNOWN);
		}
		return jButton5;
	}

	/**
	 * This method initializes jButton6	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton6() {
		if (jButton6 == null) {
			jButton6 = new JButton();
			jButton6.setBounds(new Rectangle(225, 289, 42, 25));
			jButton6.setMnemonic(KeyEvent.VK_UNDEFINED);
			jButton6.setHorizontalAlignment(SwingConstants.CENTER);
			jButton6.setText("r");
			jButton6.setComponentOrientation(ComponentOrientation.UNKNOWN);
		}
		return jButton6;
	}

	/**
	 * This method initializes jButton7	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton7() {
		if (jButton7 == null) {
			jButton7 = new JButton();
			jButton7.setBounds(new Rectangle(269, 290, 42, 25));
			jButton7.setMnemonic(KeyEvent.VK_UNDEFINED);
			jButton7.setHorizontalAlignment(SwingConstants.CENTER);
			jButton7.setText("r");
			jButton7.setComponentOrientation(ComponentOrientation.UNKNOWN);
		}
		return jButton7;
	}

}  //  @jve:decl-index=0:visual-constraint="10,10"
